package com.wy.service.impl.wy;

import com.wy.bean.BuildingBean;
import com.wy.dao.BuildingsMapper;
import com.wy.model.sys.Buildings;
import com.wy.service.wy.BuildingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("buildingServiceImpl")
public class BuildingServiceImpl implements BuildingService {

	@Autowired
	private BuildingsMapper buildingsMapper;

	@Override
	public List<BuildingBean> buildingList(Integer pageSize, Integer start,Integer residenceId,String buildingName,List<String> rids) {
		return buildingsMapper.buildingList(pageSize,start,residenceId,buildingName,rids);
	}

	@Override
	public Integer buildingSize(Integer pageSize, Integer start,Integer residenceId,String buildingName,List<String> rids) {
		return buildingsMapper.buildingSize(pageSize,start,residenceId,buildingName,rids);
	}

	@Override
	public List<Buildings> getBuildingByResidenceId(Integer residenceId) {
		return buildingsMapper.getBuildingByResidenceId(residenceId);
	}

	@Override
	public void insertBuilding(Buildings buildings) {
		buildingsMapper.insert(buildings);
	}

	@Override
	public void updateBuilding(Buildings buildings) {
		buildingsMapper.updateByPrimaryKey(buildings);
	}

	@Override
	public void deleteBuilding(List<String> groupId) {
		buildingsMapper.deleteByPrimaryKey(groupId);
	}

	@Override
	public List<Buildings> getBuildingList() {
		return buildingsMapper.getBuildingList();
	}

	@Override
	public List<BuildingBean> getBuildingListImport(List<BuildingBean> list) {
		return buildingsMapper.buildingListImport(list);
	}

	@Override
	public void insertBatch(List<BuildingBean> list) {
		buildingsMapper.insertBatch(list);
	}
}
